package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.plus.web.controller.BasePlusController;
import com.ruoyi.system.service.ILanguageKeyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 语言键Controller
 *
 * @author huyafang
 * @date 2023-03-06
 */
@RestController
@RequestMapping("/system/manage/language_key")
@Api(tags = "语言键")
public class LanguageKeyController extends BasePlusController {
    @Autowired
    private ILanguageKeyService languageKeyService;

    /**
     * 修改语言键
     */
    @PreAuthorize("@ss.hasPermi('coin-trade:common:language_key:edit')")
    @PostMapping("/editLanguageKey")
    @ApiOperation(value = "修改语言键")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "oldCode", value = "旧语言code", paramType = "form", dataType = "String"),
            @ApiImplicitParam(name = "newCode", value = "新语言code", paramType = "form", dataType = "String"),
            @ApiImplicitParam(name = "keyType", value = "键类型", paramType = "form", dataType = "String")
    })
    public R editLanguageKey(String oldCode, String newCode, String keyType) {
        languageKeyService.editLanguageKey(oldCode, newCode, keyType);
        return R.ok();
    }


}
